package edu.gatech.fiveminutesleft.model;

/**
 * Representation of locations by their String address.
 * 
 * @author daniel keyes
 */
public class LocationName {

	private String	address;

	/**
	 * Initializes a LocationName with an empty string as the address
	 */
	public LocationName() {
		this("");
	}

	/**
	 * Obtains an instance of a LocationName object from a particular task
	 * 
	 * @param getFrom
	 *            the Task to get the name from
	 * @return a LocationName object with the associated data
	 */
	public static LocationName getFromTask(Task getFrom) {
		return new LocationName(getFrom.getLocation());
	}

	/**
	 * Sets the location of a particular task using this address
	 * 
	 * @param setIn
	 *            the Task to modify
	 */
	public void setInTask(Task setIn) {
		setIn.setLocation(address);
	}

	/**
	 * Initializes a LocationName with a specified string as the address
	 * 
	 * @param address
	 *            the address or place name of the location
	 */
	public LocationName(String address) {
		this.address = address;
	}

	/**
	 * sets the address
	 * 
	 * @param address
	 *            the new address or place name of the location
	 */
	public void setAddress(String address) {
		this.address = address;
	}

	/**
	 * gets the address
	 * 
	 * @return the address or place name of the location
	 */
	public String getAddress() {
		return address;
	}
}
